Optimal. Leaf size=243 \[ \frac {(107 A+112 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.49, antiderivative size = 243, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {4172, 4107,
4005, 3859, 209, 3880} \begin {gather*} \frac {(107 A+112 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{64 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a \sec (c+d x)+a}}+\frac {(43 A+48 C) \sin (c+d x) \cos (c+d x)}{96 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos ^3(c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}-\frac {A \sin (c+d x) \cos ^2(c+d x)}{24 d \sqrt {a \sec (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4107
Rule 4172
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx &=\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\cos ^3(c+d x) \left (-\frac {a A}{2}+\frac {1}{2} a (7 A+8 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{4 a}\\ &=-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\cos ^2(c+d x) \left (\frac {1}{4} a^2 (43 A+48 C)-\frac {5}{4} a^2 A \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{12 a^2}\\ &=\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\cos (c+d x) \left (-\frac {3}{8} a^3 (21 A+16 C)+\frac {3}{8} a^3 (43 A+48 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{24 a^3}\\ &=-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\frac {3}{16} a^4 (107 A+112 C)-\frac {3}{16} a^4 (21 A+16 C) \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{24 a^4}\\ &=-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+(-A-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx+\frac {(107 A+112 C) \int \sqrt {a+a \sec (c+d x)} \, dx}{128 a}\\ &=-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {(2 (A+C)) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}-\frac {(107 A+112 C) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 d}\\ &=\frac {(107 A+112 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {(21 A+16 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {(43 A+48 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}-\frac {A \cos ^2(c+d x) \sin (c+d x)}{24 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos ^3(c+d x) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.80, size = 160, normalized size = 0.66 \begin {gather*} \frac {\left ((321 A+336 C) \tanh ^{-1}\left (\sqrt {1-\sec (c+d x)}\right )-192 \sqrt {2} (A+C) \tanh ^{-1}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )+\cos (c+d x) \left (-63 A-48 C+(86 A+96 C) \cos (c+d x)-8 A \cos ^2(c+d x)+48 A \cos ^3(c+d x)\right ) \sqrt {1-\sec (c+d x)}\right ) \tan (c+d x)}{192 d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1405\) vs.
\(2(210)=420\).
time = 24.62, size = 1406, normalized size = 5.79
method | result | size |
default | \(\text {Expression too large to display}\) | \(1406\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 8.39, size = 558, normalized size = 2.30 \begin {gather*} \left [\frac {192 \, \sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - 3 \, {\left ({\left (107 \, A + 112 \, C\right )} \cos \left (d x + c\right ) + 107 \, A + 112 \, C\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (48 \, A \cos \left (d x + c\right )^{4} - 8 \, A \cos \left (d x + c\right )^{3} + 2 \, {\left (43 \, A + 48 \, C\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (21 \, A + 16 \, C\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{384 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, -\frac {3 \, {\left ({\left (107 \, A + 112 \, C\right )} \cos \left (d x + c\right ) + 107 \, A + 112 \, C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (48 \, A \cos \left (d x + c\right )^{4} - 8 \, A \cos \left (d x + c\right )^{3} + 2 \, {\left (43 \, A + 48 \, C\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (21 \, A + 16 \, C\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) - \frac {192 \, \sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{192 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1012 vs.
\(2 (210) = 420\).
time = 2.09, size = 1012, normalized size = 4.16 \begin {gather*} \frac {\frac {192 \, \sqrt {2} {\left (A + C\right )} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {3 \, {\left (107 \, A + 112 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {3 \, {\left (107 \, A + 112 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {4 \, \sqrt {2} {\left (1599 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{14} A \sqrt {-a} + 816 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{14} C \sqrt {-a} - 18219 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{12} A \sqrt {-a} a - 12528 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{12} C \sqrt {-a} a + 91467 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{10} A \sqrt {-a} a^{2} + 64752 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{10} C \sqrt {-a} a^{2} - 177735 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{8} A \sqrt {-a} a^{3} - 124848 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{8} C \sqrt {-a} a^{3} + 100413 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} A \sqrt {-a} a^{4} + 70032 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} C \sqrt {-a} a^{4} - 26881 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} A \sqrt {-a} a^{5} - 19152 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} C \sqrt {-a} a^{5} + 3321 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} A \sqrt {-a} a^{6} + 2640 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} C \sqrt {-a} a^{6} - 205 \, A \sqrt {-a} a^{7} - 144 \, C \sqrt {-a} a^{7}\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}}{384 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^4\,\left (A+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________